package com.itheima.sc.service.pms;

import com.itheima.sc.api.pms.SkuStockApi;
import com.itheima.sc.pojo.pms.SkuStock;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SkuStockService {
    @DubboReference
    private SkuStockApi skuStockApi;

    //批量更新sku库存信息
    public void updateByPid(Integer pid, List<SkuStock> skuStockList) {
        skuStockApi.updateByPid(pid,skuStockList);
    }

    //根据商品ID及sku编码模糊搜索sku库存
    public List<SkuStock> getByPid_skuCode(Integer pid, String keyword) {
        List<SkuStock> skuStockList = skuStockApi.getByPid_skuCode(pid,keyword);
        return skuStockList;
    }
}
